Skip to content

pyicu-binary: add build-pyicu-binary.yml for riscv64 wheels - #1508

Merged
luhenry merged 1 commit into
mainfrom
pyicu-binary
Sep 8, 2026
Merged

pyicu-binary: add build-pyicu-binary.yml for riscv64 wheels#1508
luhenry merged 1 commit into
mainfrom
pyicu-binary

Conversation

@luhenry

@luhenry luhenry commented Sep 8, 2026

Copy link
Copy Markdown
Member

Compiles PyICU's C++ extension against system ICU and lets auditwheel vendor libicudata/libicuuc/libicui18n into a self-contained wheel. Upstream publishes no riscv64 wheel and carries no wheel-build CI of its own to mirror.

Differs from upstream

  • dnf install libicu-devel in CIBW_BEFORE_ALL_LINUX - upstream has no CI recipe to inherit
  • Copies /usr/share/licenses/libicu/LICENSE into the wheel - required once ICU is vendored in

Testing

  • Upstream's own test/ suite via pytest, staged with CIBW_TEST_SOURCES
  • Deselected 4 tests asserting CLDR-formatted strings/tzdata transitions pinned to ICU <=69 (the test file's own version check tops out at "68.0"); the linked ICU 74.2 renders them differently, unrelated to riscv64

License: Wheel bundles ICU (Unicode License) via auditwheel; its notice ships as LICENSE.icu since upstream carries none for it.

Patches

  • 0001-common-gate-the-deprecated-PyUnicode_WCHAR_KIND-cas.patch - Backport [gitlab.pyicu.org/main/pyicu@8850cfc, released in v2.11]. CPython 3.12 removed PyUnicode_WCHAR_KIND, which 2.7.4 still switches on unconditionally; reproduces on any host, not riscv64-specific.

Built and tested on cp312 against a from-source ICU4C 74.2 (matching the manylinux image): 69 passed, 4 deselected.

Drives cibuildwheel directly against a checkout of gitlab.pyicu.org/main/pyicu
(published to PyPI as PyICU-binary), which carries no wheel-build CI of its
own. libicu-devel 74.2 is available in the manylinux_2_39_riscv64 image's
appstream repo, so the extension links dynamically against system ICU the
same way setup.py's icu-config/pkg-config probing already expects; auditwheel
then vendors the linked libicudata/libicuuc/libicui18n into the wheel, which
is the whole point of the "-binary" name.

Two patches. The git tree itself always names the project "PyICU" (the
"-binary" rename is done outside this tree when whoever publishes the actual
PyPI project builds it), so setup.py needs the same rename or the wheel's
own METADATA reports the wrong package name and _publish-wheel.yml would
register/publish it as "pyicu" instead. 2.7.4 also predates CPython 3.12's
removal of the legacy PyUnicode_WCHAR_KIND enumerator, so building common.cpp
against a 3.12+ header fails; backports the same #if gate upstream shipped
two releases later (v2.11, commit 8850cfca5aeaf040170edca6796002feff0eb82c).

Verified locally end to end: built the patched tree against a from-source
ICU4C 74.2 (matching what the manylinux image ships) on Python 3.12 and ran
its own test suite - 69 passed, 4 deselected. Those four assert CLDR-
formatted strings and a tzdata transition pinned to ICU <=69 (the test file's
own version check tops out at "68.0"); ICU 74.2's newer CLDR/tzdata data
legitimately renders them differently, unrelated to riscv64 or this patch.
@luhenry
luhenry merged commit 2e599fa into main Sep 8, 2026
9 checks passed
@luhenry
luhenry deleted the pyicu-binary branch September 8, 2026 09:36
@luhenry luhenry linked an issue Sep 8, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyicu-binary riscv64 support

1 participant